import { ElNotification } from 'element-plus'

// 封装一下ElNotification
const showNotification = (msg, callback, type) => {
  ElNotification({
    title: '系统通知',
    message: msg,
    type: type,
    position: 'top-right',
    duration: 5000,
  })
}

// 不同类型的ElNotification
const notification = {
  error: (msg, callback) => {
    showNotification(msg, callback, "error")
  },
  success: (msg, callback) => {
    showNotification(msg, callback, "success")
  },
  warning: (msg, callback) => {
    showNotification(msg, callback, "warning")
  },
}

export default notification;